<template>
    <Header />
    <!-- 手机端 -->
    <div class="myOrderBody hidden-sm-and-up">
        <div class="order-contaienr-phone">
            <el-tabs v-model="activeName" class="demo-tabs" :stretch="true" @tab-click="handleClick">
                <el-tab-pane label="全部" name="first">
                    <div class="order-item-container">
                        <div class="order-item-box mb10" v-for="item in 3">
                            <div class="order-item">
                                <div class="order-item-title" style="color: #356CEB;font-weight: 600;font-size: 18px;">
                                    深圳海棠湾君悦酒店</div>
                                <div class="order-item-cancel" style="color: #356CEB;font-weight: 600;font-size: 18px;">
                                    2间
                                </div>
                            </div>
                            <div class="cutline" style="margin-top: 10px;"></div>
                            <div class="order-item">
                                <div class="order-item-title">订单号：HZDD10113465GD245</div>
                                <router-link to="/orderDetail" style="color: #356CEB;font-weight: 600;font-size: 18px;">
                                    <div class="order-item-cancel">
                                        <el-icon color="#000">
                                            <ArrowRightBold />
                                        </el-icon>
                                    </div>
                                </router-link>
                            </div>
                            <div class="order-item">
                                <div class="order-item-title">下单时间：2024-1-18 20:18:02</div>
                            </div>
                            <div class="order-item">
                                <div class="order-item-title" style="display: flex;align-items: center;gap: 10px;"><svg
                                        t="1711967334371" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                        xmlns="http://www.w3.org/2000/svg" p-id="5203" width="15" height="15">
                                        <path
                                            d="M465.622 0.96V465.62H0.96V0.96h464.664z m0 557.418V1023.04H0.96V558.378h464.664zM93.712 372.486h278.774V93.712H93.712v278.774z m0 557.036h278.774V651.514H93.712v278.008z m185.892-742.672v92.88H186.85v-92.88h92.754z m0 557.546v92.882H186.85V744.4h92.754zM1023.04 0.96v464.664H558.378V0.96H1023.04z m0 557.42v278.772H744.268v-92.88h-92.88V1023.04h-92.884V558.378h278.9v92.88h92.884v-92.88h92.754z m-371.528-185.892h278.774V93.712H651.514v278.774z m185.636-185.636v92.88h-92.88v-92.88h92.88z m0 743.438v92.754h-92.88V930.16l92.88 0.128z m185.892 0v92.754H930.16V930.16l92.88 0.128z"
                                            fill="#515151" p-id="5204"></path>
                                    </svg>订单二维码</div>

                            </div>
                            <div class="order-item">
                                <div class="order-item-title">房间信息</div>
                            </div>

                            <div class="order-keyword" v-for="(item,index) in 2" :key="index">
                                <div>
                                    <div class="keyword-title">房间</div>
                                    <div class="keyword-content">儒雅大床房/含早餐</div>
                                </div>
                                <div>
                                    <div class="keyword-title">价格</div>
                                    <div class="keyword-content">1036.50元</div>

                                </div>
                                <div>
                                    <div class="keyword-title">数量</div>
                                    <div class="keyword-content">3晚</div>

                                </div>
                                <div style="display: flex;flex-direction: column;align-items: center">
                                    <div class="keyword-title">状态</div>
                                    <div class="keyword-content"
                                        style="color: #4BAE50;font-weight: 700;font-size: 18px">待入住</div>

                                </div>
                            </div>
                            <div class="cutline"></div>
                            <!-- <div class="flex-between">
                                <div class="price">
                                    总计￥2073.00
                                </div>
                                <div class="keyword-content"
                                        style="color: #4BAE50;font-weight: 700;font-size: 18px">待入住</div>
                            </div> -->
                            <div class="price">
                                总计￥2073.00
                            </div>

                        </div>

                    </div>

                </el-tab-pane>
                <el-tab-pane label="待确认" name="second">待确认</el-tab-pane>
                <el-tab-pane label="已确认" name="third">已确认</el-tab-pane>
                <el-tab-pane label="已变更" name="fourth">已变更</el-tab-pane>
                <el-tab-pane label="已关闭" name="fifth">已关闭</el-tab-pane>

            </el-tabs>
        </div>
    </div>
    <!-- PC端 -->
    <div class="myOrderBody hidden-xs-only">
        <div class="previewByDate">
            <div class="title">
                我的订单
            </div>
        </div>
        <div class="order-contaienr">
            <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
                <el-tab-pane label="全部" name="first">
                    <div class="order-item-container">
                        <div class="order-item">
                            <div class="order-item-title">订单号：HZDD10113465GD245</div>
                            <div class="order-item-date">3月8日 周五 —— 3月11日 周一</div>
                            <div class="order-item-night">入住天数：3晚</div>
                            <div class="order-item-cancel" @click="cancelOrder = true">取消订单</div>
                        </div>
                        <div class="order-item">
                            <div class="order-item-title">下单时间：2024-1-18 20:18:02</div>
                            <div class="order-item-date">深圳海棠湾君悦酒店</div>
                            <div class="order-item-night">房间数量：2间</div>
                        </div>
                        <div class="order-item">
                            <div class="order-item-title" style="display: flex;align-items: center;gap: 10px;"><svg
                                    t="1711967334371" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                    xmlns="http://www.w3.org/2000/svg" p-id="5203" width="15" height="15">
                                    <path
                                        d="M465.622 0.96V465.62H0.96V0.96h464.664z m0 557.418V1023.04H0.96V558.378h464.664zM93.712 372.486h278.774V93.712H93.712v278.774z m0 557.036h278.774V651.514H93.712v278.008z m185.892-742.672v92.88H186.85v-92.88h92.754z m0 557.546v92.882H186.85V744.4h92.754zM1023.04 0.96v464.664H558.378V0.96H1023.04z m0 557.42v278.772H744.268v-92.88h-92.88V1023.04h-92.884V558.378h278.9v92.88h92.884v-92.88h92.754z m-371.528-185.892h278.774V93.712H651.514v278.774z m185.636-185.636v92.88h-92.88v-92.88h92.88z m0 743.438v92.754h-92.88V930.16l92.88 0.128z m185.892 0v92.754H930.16V930.16l92.88 0.128z"
                                        fill="#515151" p-id="5204"></path>
                                </svg>订单二维码</div>

                        </div>
                        <div class="cutline"></div>
                        <div class="order-keyword" v-for="(item,index) in 2" :key="index">
                            <div>
                                <div class="keyword-title">用户信息</div>
                                <div class="keyword-content">王五 18878787878</div>
                                <div class="keyword-content">王五 18878787878</div>

                            </div>
                            <div>
                                <div class="keyword-title">房间</div>
                                <div class="keyword-content">儒雅大床房/含早餐</div>
                            </div>
                            <div>
                                <div class="keyword-title">价格</div>
                                <div class="keyword-content">1036.50元</div>

                            </div>
                            <div>
                                <div class="keyword-title">数量</div>
                                <div class="keyword-content">3晚</div>

                            </div>
                            <div>
                                <div class="keyword-title">操作</div>
                                <div class="keyword-content cursor" style="color: #356CEB;" @click="changeRoomInfo = true">修改</div>
                            </div>
                            <div style="display: flex;flex-direction: column;align-items: center">
                                <div class="keyword-title">状态</div>
                                <div class="keyword-content" style="color: #4BAE50;font-weight: 700;font-size: 18px">待入住
                                </div>

                            </div>
                        </div>
                        <div class="cutline"></div>
                        <div class="order-keyword">
                            <div>
                                <div class="keyword-title">单位</div>
                                <div class="keyword-content">王五 18878787878</div>
                                <div class="keyword-content">王五 18878787878</div>

                            </div>
                            <div>
                                <div class="keyword-title">邮箱</div>
                                <div class="keyword-content">儒雅大床房/含早餐</div>
                            </div>
                            <div>
                                <div class="keyword-title">联系人</div>
                                <div class="keyword-content">1036.50元</div>

                            </div>
                            <div>
                                <div class="keyword-title">联系电话</div>
                                <div class="keyword-content">3晚</div>

                            </div>
                            <div>
                                <div class="keyword-title">操作</div>
                                <div class="keyword-content cursor" style="color: #356CEB;" @click="changeContactInfo = true">修改</div>
                            </div>

                        </div>
                        <div class="cutline"></div>
                        <div class="price">
                            总计￥2073.00
                        </div>

                    </div>

                </el-tab-pane>
                <el-tab-pane label="待确认" name="second">待确认</el-tab-pane>
                <el-tab-pane label="已确认" name="third">已确认</el-tab-pane>
                <el-tab-pane label="已变更" name="fourth">已变更</el-tab-pane>
            </el-tabs>
        </div>
    </div>

    <!-- 取消订单确认框 -->
    <el-dialog v-model="cancelOrder" title="提示" width="500">
        <span>是否确认取消订单？</span>
        <template #footer>
            <div class="dialog-footer">
                <el-button @click="cancelOrder = false">取消</el-button>
                <el-button type="primary" @click="cancelOrder = false">
                    确定
                </el-button>
            </div>
        </template>
    </el-dialog>
    <!-- 变更房间的对话框 -->
    <el-dialog v-model="changeRoomInfo" title="变更房间信息" width="30%" :before-close="handleClose">
        <div class="bold">选择入住时间</div>
        <div class="dateChange bgColF9 bdr5 pd10 mt10 flex-around">
            <span>03月08日<el-icon><ArrowRight /></el-icon></span> 至 <span>03月11日<el-icon><ArrowRight /></el-icon></span>
        </div>
        <div class="mb10 mt10 bold">入住人信息</div>
        <div class="bgColF9 bdr5 pd10 mb10">
            <div class="flex-between bdD8 pd10">
                <div>入住人名称</div>
                <div>王五</div>
            </div>
            <div class="flex-between bdD8 pd10">
                <div>入住人电话</div>
                <div>18888888888</div>
            </div>
        </div>
        <div class="bgColF9 bdr5 pd10">
            <div class="flex-between bdD8 pd10">
                <div>入住人名称</div>
                <div>王五</div>
            </div>
            <div class="flex-between bdD8 pd10">
                <div>入住人电话</div>
                <div>18888888888</div>
            </div>
        </div>
        <template #footer>
            <div class="dialog-footer">
                <el-button @click="dialogVisible = false">取消房间</el-button>
                <el-button type="primary" @click="dialogVisible = false">
                    变更
                </el-button>
            </div>
        </template>
    </el-dialog>
    <!-- 变更订单信息的对话框 -->
    <el-dialog v-model="changeContactInfo" title="变更订单信息" width="30%" :before-close="handleClose">
        <div class="bgColF9 bdr5 pd10 mb10">
            <div class="flex-between bdD8 pd10">
                <div class="color000 bold">单位</div>
                <div>王五</div>
            </div>
            <div class="flex-between bdD8 pd10">
                <div class="color000 bold">邮箱</div>
                <div>18888888888</div>
            </div>
            <div class="flex-between bdD8 pd10">
                <div class="color000 bold">联系人</div>
                <div>王五</div>
            </div>
            <div class="flex-between bdD8 pd10">
                <div class="color000 bold">联系人手机号</div>
                <div>18888888888</div>
            </div>
        </div>
    </el-dialog>
</template>
<script lang="ts" setup>
    import Header from '@/components/Header.vue'
    import { ref } from 'vue'
    import type { TabsPaneContext } from 'element-plus'

    const activeName = ref('first')
    const cancelOrder = ref(false)
    const changeRoomInfo = ref(false)
    const changeContactInfo = ref(false)
    const handleClick = (tab: TabsPaneContext, event: Event) => {
        console.log(tab, event)
    }
</script>
<style lang="scss">
    @import '@/assets/variables.scss';

    .flex-between {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .myOrderBody {
        max-width: $border-primary-max-width;
        margin: 0 auto;
        margin-bottom: 30px;

        .previewByDate {
            display: flex;
            height: 50px;
            color: #fff;
            background-color: #356CEB;
            padding: 0 20px;
            margin-top: 30px;
            align-items: center;

            justify-content: space-between;

            .title {
                display: flex;
                gap: 10px;
                align-items: center;
            }
        }

        .order-contaienr-phone {
            .el-tabs__item {
                padding: 0 15px !important;
            }

            .el-tabs__header {
                margin: 0;
            }

            .el-tabs__item {
                height: 60px;
            }

            .el-tabs__nav-scroll {
                height: 60px;
                line-height: 60px;
            }

            .order-item-container {

                background-color: #F4F4F4;
                padding: 15px;
                font-size: 14px;

                .cutline {
                    border-bottom: 1px dashed #ccc;
                    margin: 20px 0;

                }

                .order-item-box {
                    background-color: #fff;
                    padding: 10px 15px;

                }

                .order-item {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-bottom: 5px;

                    .order-item-title {}

                    .order-item-date {
                        width: 350px;


                    }

                    .order-item-night {
                        width: 280px;


                    }

                    .order-item-cancel {

                        cursor: pointer;
                        color: #ccc;
                    }
                }



                .order-keyword {
                    display: flex;
                    justify-content: space-between;
                    width: 100%;

                    margin-top: 5px;
                    color: #929292;

                    .keyword-title {
                        margin-bottom: 5px;
                    }

                    .keyword-content {
                        color: #3d3d3d;
                        font-size: 14px;
                    }
                }

                .price {
                    font-weight: 700;
                    font-size: 20px;
                    display: flex;
                    justify-content: flex-end;
                }
            }
        }

        .order-contaienr {
            padding: 20px;
            border: 1px solid #ccc;

            .order-item-container {
                background-color: #EDF3FD;
                padding: 20px;

                .order-item {
                    display: flex;
                    margin-bottom: 20px;

                    .order-item-title {
                        width: 350px;

                    }

                    .order-item-date {
                        width: 350px;


                    }

                    .order-item-night {
                        width: 280px;


                    }

                    .order-item-cancel {

                        cursor: pointer;
                        color: #ccc;
                    }
                }

                .cutline {
                    border-bottom: 1px dashed #ffffff;
                    margin: 20px 0;

                }

                .order-keyword {
                    display: flex;
                    justify-content: space-between;
                    width: 100%;

                    margin-top: 20px;
                    color: #929292;

                    .keyword-title {
                        margin-bottom: 20px;
                    }

                    .keyword-content {
                        color: #3d3d3d;
                        font-size: 14px;
                    }
                }

                .price {
                    font-weight: 700;
                    font-size: 20px;
                    display: flex;
                    justify-content: flex-end;
                }
            }
        }
    }
</style>